package cn.stylefeng.guns.modular.cb.controller;

import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
import cn.stylefeng.guns.modular.cb.entity.CbResume;
import cn.stylefeng.guns.modular.cb.model.params.CbResumeParam;
import cn.stylefeng.guns.modular.cb.service.CbResumeService;
import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.kernel.model.response.ResponseData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 控制器
 * 简历
 * @author wj
 * @Date 2021-01-06 21:06:44
 */
@RestController
@RequestMapping("/api/resume")
public class CbResumeController extends BaseController {

    @Autowired
    private CbResumeService cbResumeService;

    /**
     * 新增接口
     *
     * @author wj
     * @Date 2021-01-06
     */
    @RequestMapping("/addItem")
    public ResponseData addItem(CbResumeParam cbResumeParam) {
        this.cbResumeService.add(cbResumeParam);
        return ResponseData.success();
    }

    /**
     * 编辑接口
     *
     * @author wj
     * @Date 2021-01-06
     */
    @RequestMapping("/editItem")
    public ResponseData editItem(CbResumeParam cbResumeParam) {
        this.cbResumeService.update(cbResumeParam);
        return ResponseData.success();
    }

    /**
     * 删除接口
     *
     * @author wj
     * @Date 2021-01-06
     */
    @RequestMapping("/delete")
    public ResponseData delete(CbResumeParam cbResumeParam) {
        this.cbResumeService.delete(cbResumeParam);
        return ResponseData.success();
    }

    /**
     * 查看详情接口
     *
     * @author wj
     * @Date 2021-01-06
     */
    @RequestMapping("/detail")
    public ResponseData detail(CbResumeParam cbResumeParam) {
        CbResume detail = this.cbResumeService.getById(cbResumeParam.getId());
        return ResponseData.success(detail);
    }

    /**
     * 查询列表
     *
     * @author wj
     * @Date 2021-01-06
     */
    @RequestMapping("/list")
    public LayuiPageInfo list(CbResumeParam cbResumeParam) {
        return this.cbResumeService.findPageBySpec(cbResumeParam);
    }

}


